<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<style>
    .box {
        background-color: red;
        width: 500px;
    }
    .box::after {
        display: block;
        content: '';
        /*? 没高 用padding来当高 以width的50%*/
        padding-top: 50%;
    }
</style>
<body>
<div class="box"></div>
</body>
</html>
